package com.cqyc.network.getid

import com.cqyc.network.model.ConfigInfo


object GetMyInformationBox {
    var configInfo: ConfigInfo? = null
    var canSender = false
    private var interList: OnGetMyInformation? = null
    private var onDisconnectionIn: OnDisconnectionInformation? = null

    fun addInterface(o: OnGetMyInformation) {
        interList = o
    }

    fun addOnDisconnectionIn(on: OnDisconnectionInformation) {
        onDisconnectionIn = on
    }

    fun getMyId(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getId()
        }
    }

    fun getToken(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getToken()
        }
    }

    fun getAppId(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getAppId()
        }
    }

    fun getVersion(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getVersion()
        }
    }

    fun getUid(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getUId()
        }
    }

    fun isBuyer(): Boolean {
        return if (interList == null) {
            false
        } else {
            interList!!.isBuyer()
        }
    }

    fun getSource(): String {
        return if (interList == null) {
            ""
        } else {
            interList!!.getSource()
        }
    }

    fun postDisconnection() {
        if (onDisconnectionIn != null) {
            onDisconnectionIn!!.onDisconnection()
        }
    }
}